#pragma once

#include <QTreeWidget>
#include <QMap>
#include "publicgui_global.h"

namespace CoreBase
{
	class ActorBase;
	class Drawable;
}

namespace PublicGui
{
	class DynamicTreeWidgetItemBase;

	class PUBLICGUI_EXPORT PropertyTreeWidget:public QTreeWidget
	{
		Q_OBJECT
	public:
		PropertyTreeWidget(CoreBase::ActorBase* actor,QWidget * parent = 0);
		~PropertyTreeWidget();

		virtual void setWidgetActor(CoreBase::ActorBase* actor);
		CoreBase::ActorBase* getCurrentActor()
		{
			return _currentActor;
		}
	protected:
		virtual void initializationUI(bool havechild = true);
		QString m_type;
		CoreBase::ActorBase*							_currentActor;
		QMap<QString,DynamicTreeWidgetItemBase*>		_groupToItem;
		void initializationChild(CoreBase::ActorBase* mactor,QTreeWidgetItem* parent,QString& propertyprefix);
		void setWidgetActorChild(CoreBase::ActorBase* mactor,QString& propertyprefix);
		void setUpWidget(QTreeWidgetItem* parent);
	};
}